﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightDemo
{
    public partial class SilverlightDemoPage : UserControl
    {
        public SilverlightDemoPage()
        {
            InitializeComponent();
        }

      
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

            ScalingModal.Instance.Initialize(MainGrid, DisableControl);
            Grid.SetColumnSpan(ScalingModal.Instance, 3);
            Grid.SetRowSpan(ScalingModal.Instance, 3);
            AnimationSelectionComboBox.SelectedIndex = 0;
            BackgroundOpacitySlider.Value = 0.5;


            Storyboard s = Resources["Intro"] as Storyboard;
            s.Begin();
        }






        private void ExpandButton_Click(object sender, RoutedEventArgs e)
        {
            ScalingModal.Instance.Expand(new PopUpUserControl());
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            ScalingModal.Instance.Collapse();
        }


        private void AnimationSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ScalingModal.Instance.Animation = (ScalingModalExpandCollapseAnimation)Enum.Parse(typeof(ScalingModalExpandCollapseAnimation), (AnimationSelectionComboBox.SelectedItem as ComboBoxItem).Name, true);
        }

        private void BackgroundOpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            ScalingModal.Instance.BackgroundOpacity = e.NewValue;
        }

     


    }
}
